package com.hmy.finance.service.core;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hmy.finance.dal.po.ContractDailyBillPo;

import java.time.LocalDate;
import java.util.List;

/**
 * @author songkf
 * @description 针对表【contract_daily_bill(合同日费用流水)】的数据库操作Service
 * @createDate 2024-02-21 18:55:01
 */
public interface IContractDailyBillService extends IService<ContractDailyBillPo> {
    /**
     * 根据合同ID和处理日期查询合同日费用流水
     *
     * @param contractId 合同ID
     * @param handleDate 处理日期
     * @return ContractDailyBillPo 合同日费用流水
     * @author songkf
     */
    ContractDailyBillPo queryContractDailyBillByContractIdWithDate(Long contractId, LocalDate handleDate);

    Boolean clearContractDailyBill(Long contractId, LocalDate localDate);

    List<ContractDailyBillPo> queryContractDailyBillListByContractIdAndDateArea(Long contractId, LocalDate localDate, LocalDate now);

    /**
     * Selects a list of ContractDailyBillPo objects that are waiting for offset, within the specified customer, contract, start date, and end date.
     *
     * @param customerId The ID of the customer
     * @param contractId The ID of the contract
     * @param startDate  The start date for the selection
     * @param endDate    The end date for the selection
     * @return A list of ContractDailyBillPo objects that meet the criteria
     */
    List<ContractDailyBillPo> selectWaitOffsetList(Long customerId, Long contractId, LocalDate startDate, LocalDate endDate);
}
